<!--
 * @Author: Liyiqi
 * @LastEditor: Liyiqi
 * @Date: 2020-07-02 09:29:31
 * @LastEditTime: 2021-06-17 18:17:31
 * @Description:  搜索组件封装
-->
<template>
  <div>
    <el-row class="search-row">
      <el-col :span="24">
        <slot name="noFilterContent"></slot>
        <el-collapse-transition>
          <div v-if="showContent">
            <slot name="filterContent"></slot>
          </div>
        </el-collapse-transition>
      </el-col>
    </el-row>
    <el-row class="search-row">
      <el-col :span="8" :offset="16" style="text-align:right;">
        <el-button
          @click="closeFilter"
          :icon="showContent?'el-icon-arrow-up':'el-icon-arrow-down'"
          class="white-btn reset-btn filterClose"
          v-if="isShowFilter"
        >{{showContent?'展开':'折叠'}}</el-button>
        <slot name="searchBtn"></slot>
        <slot name="resetBtn"></slot>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'searchStyle',
  props: {
    isShowFilter: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      showContent: false
    }
  },
  methods: {
    closeFilter () {
      this.showContent = !this.showContent
    }
  }
}
</script>

<style>

</style>
